FBPACK page# 0001 next
2: COMMENT ⊗   VALID 00020 PAGES
3: C REC  PAGE   DESCRIPTION
4: C00001 00001
5: C00003 00002    IFN FTDISK,<BEGIN FBPACK↔SUBTTL LIBRASCOPE SWAPPER AND FAST-BAND SERVICE
6: C00004 00003    ↑FBINI: SETZM   FBQUE           INITIALIZE
7: C00007 00004    FAST BAND SERVICE UUO'S
8: C00010 00005    ADDRESS CHECK THE GOODIE TABLE - DON'T RETURN UNLESS HAPPY.
9: C00013 00006    UTILITY ROUTINES.
10: C00015 00007    UUO CALL TO GET A BAND
11: C00018 00008    UUO TO GET PHYSICAL BAND NUMBER AND OFFSET
12: C00021 00009    UUO TO TELL YOU IF YOU HAVE A TRANSFER IN PROGRESS
13: C00023 00010    ROUTINE TO GET A BAND AT ANY LEVEL
14: C00025 00011    ROUTINE TO RELEASE A BAND AT ANY LEVEL
15: C00027 00012    ROUTINES TO READ AND WRITE A FAST BAND
16: C00029 00013    THIS ROUTINE GETS THE PHYSICAL BAND NUMBER FROM THE LOGICAL BAND NUMBER
17: C00032 00014    COMMON READ-WRITE ROUTINE
18: C00036 00015    INTERRUPT LEVEL CODE . . .
19: C00038 00016    FIRST, THE DISK STARTUP ROUTINE . . .
20: C00043 00017    COME HERE WHEN A TASK HAS BEEN COMPLETED . . .
21: C00046 00018    HERE AFTER THE TV CAMERA INTERRUPT HAS GONE OFF.
22: C00047 00019    DISK ERROR HANDLER.
23: C00050 00020    IOP ERROR RECOVERY
24: C00054 ENDMK
25: C⊗;
    FBPACK page# 0002 next  prev
27: IFN FTDISK,<BEGIN FBPACKSUBTTL LIBRASCOPE SWAPPER AND FAST-BAND SERVICE
28: ;JAM 22-APR-69
29: 
30: ;;POINTERS INTO FBBAND
31: 
32: FBLOGP:        POINT 6,(AC3),23        ; POINTS TO LOGICAL BAND NUMBER
33: FBLUZP:         POINT 4,(AC3),27        ; COUNTS WHEN BAND LOSES
34: FBPROT:         POINT 2,(AC3),29        ; POINTS TO FOREIGN JOB READ-WRITE ENABLE BITS
35: FBJOBP:        POINT 6,(AC3),35        ; POINTS TO JOB NUMBER
36: 
37: RDEN←←1         ; READ ENABLE
38: WREN←←2         ; WRITE ENABLE
39: 
40: DSKCHL←←CAT(CH,\DSKCHN)
    FBPACK page# 0003 next  prev
42: FBINI: SETZM   FBQUE           ;INITIALIZE
43:         SETZM   FBTASK
44:         SETZM   FBSBUSY
45:         SETOM   FBBUSY
46:         SETZM   FBACT
47:         MOVEI   AC1,LJOBN-1     ;ASSUME THE WORST.
48:         MOVEM   AC1,JOBNM1
49:         CONSZ   DSK,1B27        ;IF BIT 27 IS ON, THE DISK IS OFF LINE
50:         POPJ    P,              ;IF NO DISK, QUIT NOW
51:         SETOM   FBACT           ;FAST BANDS ARE HERE TODAY.
52:         MOVNI   AC1,14          ;KEEP RESERVE FOR ERRORS, LARGE JOBS & SEGMENTS
53:         MOVEM   AC1,JOBNM1
54:         MOVE    AC3,[XWD -NBANDS,FBBAND]
55: FBIN4:  SKIPGE  (AC3)           ;IS THIS PERMANENT LOSER?
56:         JRST    FBIN5           ;YES.
57:         LDB     AC2,FBLUZP      ;GET THE ERROR COUNT.
58:         LDB     AC1,FBLOGP      ;GET LOGICAL NUMBER
59:         CAIGE   AC1,MAXFB       ;IS IT A SWAPPING BAND?
60:         SETZM   (AC3)           ;NOT FOR SWAPPING. DEASSIGN IT.
61:         DPB     AC2,FBLUZP      ;RESTORE THE COUNT.
62:         AOS     JOBNM1          ;ANOTHER BAND FREE!
63: FBIN5:  AOBJN   AC3,FBIN4       ;LOOP THRU THE BANDS.
64: 
65:         MOVE    AC3,SYSBAND
66:         LSH     AC3,-=12
67:         SETOM   FBBAND(AC3)     ;PROTECT SYSTEM
68:         SOS     JOBNM1          ;GOBBLED ANOTHER
69:         MOVEM   AC3,SYSBND      ;SET RIGHT-ADJUSTED COPY OF SYSTEM BAND NUMBER
70: 
71: IFN FTDDT,<IFN  FTDSWP,<
72:         SKIPN   DDTSWP          ;IS SWAPPING DDT REQUESTED?
73:         JRST    FBIN6           ;NO. NO NEED TO RESERVE A BAND.
74:         MOVE    AC3,DDTBAND
75:         LSH     AC3,=-12
76:         SETOM   FBBAND(AC3)     ;SAVE A BAND FOR SWAPPING DDT.
77:         SOS     JOBNM1          ;AND ANOTHER BAND GOBBLED.
78: >>
79: 
80: FBIN6:  MOVE    AC1,JOBNM1      ;THIS IS THE NUMBER OF BANDS-RESERVE.
81:         CAILE   AC1,JOBN-1      ;CAN'T BE LARGER THAN THIS
82:         MOVEI   AC1,JOBN-1      ;
83:         MOVEM   AC1,JOBNM1      ;THIS IS NOW THE MAX JOB NUMBER
84:         POPJ    P,
    FBPACK page# 0004 next  prev
86: ;FAST BAND SERVICE UUO'S
87: ;CALLING SEQUENCES . . .
88: ;       UFBRD <AC CONTAINING BAND NUMBER>,<ADDRESS OF GOODIE TABLE>
89: ;       <RETURN HERE IF ERRORS ENCOUNTERED>
90: 
91: ;       UFBWRT <AC CONTAINING BAND NUMBER>,<ADDRESS OF GOODIE TABLE>
92: ;       <RETURN HERE IF ERRORS ENCOUNTERED>
93: 
94: ;WHERE GOODIE TABLE IS . . .
95: ;       1) CORE ADDRESS, SIGN BIT SET IF NO WAIT
96: ;       2) NUMBER OF WORDS
97: ;       3) DISK SECTOR ADDRESS (.LE.2431 DECIMAL)
98: 
99: UFBRD: PUSHJ   P,UFBSET                ;CHECK GOODIES. DON'T RETURN IF ERROR.
100:         XCTR    XR,[SKIPL (UUO)]                ;IS THIS A NO WAIT UUO?
101:         JRST    NORRD                   ;NO. GO DO THE READ AND WAIT.
102:         MOVSI   DAT,UFBD                ;QUEUE UP THE TRANSFER.
103:         HRRI    DAT,(J)
104:         PUSHJ   P,FBRD
105:         POPJ    P,                      ;LOSE.
106:         CONO    PI,DSKON                ;TURN ON THE DISK
107:         MOVEI   AC1,FBINP               ;SET THE TRANSFER IN PROGRESS BIT
108:         IORM    AC1,JBTSTS(J)
109:         JRST    CPOPJ1                  ;AND RETURN.
110: 
111: NORRD:  SETZ    DAT,                    ;ZERO DAT FOR A TRANSFER AND WAIT UUO.
112:         PUSHJ   P,FBRD                  ;QUEUE TRANSFER.
113:         POPJ    P,                      ;OOPS.
114:         JRST    FBWAIT                  ;WAIT UNTIL TRANSFER IS COMPLETE
115: 
116: UFBWRT:PUSHJ   P,UFBSET                ;ADDRESS CHECK GOODIES. 
117:         XCTR    XR,[SKIPL (UUO)]        ;SAME AS UFBRD ABOVE.
118:         JRST    NORWR
119:         MOVSI   DAT,UFBD
120:         HRRI    DAT,(J)
121:         PUSHJ   P,FBWRT
122:         POPJ    P,
123:         CONO    PI,DSKON
124:         MOVEI   AC1,FBINP
125:         IORM    AC1,JBTSTS(J)
126:         JRST    CPOPJ1
127: 
128: NORWR:  SETZ    DAT,
129:         PUSHJ   P,FBWRT
130:         POPJ    P,
131: FBWAIT: MOVNI   DSER,IOWQ       ;UUO LEVEL WAIT ROUTINE. CALLED AFTER FBCOM.
132:         MOVEM   DSER,JOBQUE(J)  ;REQUEUE TO IOWQ
133:         CONO    PI,DSKON        ;TURN ON THE DISK CHANNEL
134:         PUSHJ   P,WSCHED        ;TURN OFF THIS JOB
135:         SKIPLE  FBRETRY(AC1)    ;HERE WHEN TASK DONE. WERE THERE ERRORS?
136:         AOS     (P)             ;NO ERROR. SET SKIP RETURN TO INDICATE SUCCESS
137:         CAIE    AC1,FBSPARE     ;IS THIS THE SPARE TASK BLOCK?
138:         JRST    FSGIVE          ;NOT SPARE. RETURN TASK BLOCK TO FREE STORAGE
139:         SETZM   FBSBUSY         ;RELEASE SPARE
140:         POPJ    P,              ;RETURN TO UUOCON
    FBPACK page# 0005 next  prev
142: ;ADDRESS CHECK THE GOODIE TABLE - DON'T RETURN UNLESS HAPPY.
143: 
144: UFBSET: MOVEI   TAC1,FBINP              ;IS THERE ALREADY A TRANSFER IN PROGRESS
145:         TDNE    TAC1,JBTSTS(J)
146:         PUSHJ   P,FBCW                  ;YES, WAIT FOR IT
147:         MOVEI   TAC1,FBERP              ;CLEAR ERROR BIT FOR PREVIOUS TRANSFER.
148:         ANDCAM  TAC1,JBTSTS(J)          ;CAN'T GET STATUS FOR PREVIOUS ONE
149:         XCTR    XR,[HRRZ UCHN,(UCHN)]
150:         PUSHJ   P,FBBGET                ;CHECK BAND NUMBER.
151:         XCTR    XR,[HRRZ TAC1,(UUO)]    ; PICK UP CORE ADDRESS
152:         PUSHJ   P,RELOCA                ; RELOCATE AND ADDRESS CHECK
153:         JRST    UFBSE2                  ; ILM
154:         JUMPL   TAC1,UFBSE2             ; REFERENCE TO WRITE PROTECTED CORE.
155:         MOVE    TAC,TAC1                ; SAVE RELOCATED ADDRESS
156:         XCTR    XR,[MOVM AC2,1(UUO)]    ; PICK UP WORD COUNT
157:         JUMPE   AC2,UFBSE2
158:         XCTR    XR,[MOVE TAC1,(UUO)]    ; GET CORE ADDRESS AGAIN!
159:         ADDI    TAC1,-1(AC2)            ; ADDRESS CHECK LAST WORD OF TRANSFER
160:         PUSHJ   P,RELOCB                ; ADDRESS CHECK LAST WORD OF TRANSFER
161:                                         ; (MUST BE IN SAME SEGMENT)
162:         JRST    UFBSE2
163:         XCTR    XR,[SKIPL TAC1,2(UUO)]
164:         CAILE   TAC1,2*=1216-1
165:         JRST    UFBSE1
166:         POPJ    P,
167: 
168: ; ROUTINE TO CHECK A LOGICAL OR PHYSICAL BAND NUMBER
169: ; ENTER WITH NUMBER IN UCHN
170: 
171: FBBGET: TRNE    UCHN,400000             ;PHYSICAL BAND NUMBER?
172:         CAIL    UCHN,400000+NBANDS      ;YES. SKIP IF IN RANGE. 
173:         CAIGE   UCHN,MAXFB              ;LOGICAL BAND, (OR PHYSICAL TOO BIG.)
174:         POPJ    P,                      ;BAND IS IN BOUNDS.
175:         JSP     TAC,UUOMES              ;TELL LOSER.
176:         ASCIZ   /LOGICAL OR PHYSICAL BAND NUMBER OUT OF BOUNDS. UUO/
177: 
178: UFBSE1: JSP TAC,UUOMES
179:         ASCIZ /DISK ADDRESS OUT OF BOUNDS, UUO/
180: 
181: UFBSE2: JSP TAC,UUOMES
182:         ASCIZ /ADDRESS CHECK FOR FAST-BAND CALL, UUO/
    FBPACK page# 0006 next  prev
184: ;UTILITY ROUTINES.
185: 
186: ;HERE IF HE TRIES TO START ANOTHER TRANSFER WHILE A NO-WAIT IS IN PROGRESS.
187: FBCW:   MOVNI   AC1,IOWQ                ;WAIT FOR TRANSFER TO COMPLETE.
188:         MOVEM   AC1,JOBQUE(J)           ;REQUEUE JOB TO IOWQ
189:         MOVEI   AC1,FBJWT               ;SET FBWAIT IN JBTSTS
190:         IORM    AC1,JBTSTS(J)           ;
191:         JRST    WSCHED                  ;WAIT.
192: 
193: ;HERE TO COMPLETE A NO-WAIT TRANSFER.
194: UFBD:   MOVEI   AC1,FBINP!FBJWT         ;HERE WHEN TRANSFER COMPLETES.
195:         SETZ    AC2,                    ;ASSUME NO ERRORS.
196:         TRZE    DAT,400000              ;WAS THERE AN ERROR.
197:         MOVEI   AC2,FBERP               ;YES. PICKUP ERROR BIT.
198:         MOVEI   J,(DAT)                 ;LOAD JOB NUMBER.
199:         SOS     JBTGLU(J)               ;UNGLUE THIS JOB.
200: IFN FTSTAT,<PUSHJ P,GLUSTT>
201:         IORB    AC2,JBTSTS(J)           ;TURN ON ERROR BIT IF NEEDED.
202:         ANDCAM  AC1,JBTSTS(J)           ;SHUT OFF TRANSFER IN PROGRESS AND WAIT BITS
203:         MOVM    AC1,JOBQUE(J)           ;IS THIS GUY IN IOWQ?
204:         CAIN    AC1,IOWQ
205:         TRNN    AC2,FBJWT               ;IN IOWQ. WAS HE WAITING FOR ME?
206:         POPJ    P,                      ;NOT IOWQ OR NOT WAITING FOR ME.
207:         MOVNI   AC1,RUNQ                ;HE WAS WAITING. REQUEUE HIM TO RUNQ.
208:         MOVEM   AC1,JOBQUE(J)
209:         JRST    REQUE
    FBPACK page# 0007 next  prev
211: ;UUO CALL TO GET A BAND
212: ; CALLING . . .
213: ;       MOVE AC,[XWD <OFFSET & ENABLE BITS>,<BAND NUMBER>
214: ;       CALL AC,[SIXBIT /UFBGET/]
215: ;       <FAILURE RETURN>
216: ;       <SUCCESS RETURN, PHYSICAL BAND NUMBER IN AC>
217: ; <OFFSET> MAY BE ZERO, FOR LET THE SYSTEM SET IT.
218: ; <ENABLE BITS> ARE 100000 FOR READ ENABLE, 200000 FOR WRITE ENABLE
219: ; <BAND NUMBER> MAY BE 0 TO MAXFB-1 OR 400000 BIT ON FOR PHYSICAL BAND
220: 
221: UFBGET:
222:         PUSH    P,TAC
223:         TLNN    TAC,403777              ;ANY OFFSET THERE?
224:         JRST    UFBGE1                  ;NO.
225:         LDB     AC1,[POINT 11,TAC,17]
226:         CAIL    AC1,=1216
227:         JRST    OFFTL                   ;OFFSET TOO LARGE.
228: UFBGE1: HRRZ    UCHN,(P)                ;PICK UP BAND NUMBER
229:         PUSHJ   P,FBBGET                ;CHECK FOR LEGAL BAND NUMBER.
230:         TRNE    UCHN,400000             ;IS THIS A PHYSICAL REQUEST?
231:         JRST    UFBGE2                  ;YES. DON'T NEED TO CALL FBGET.
232:         PUSHJ   P,FBGET                 ;GO GET A BAND FOR THIS GUY.
233:         JRST    TPOPJ                   ;NO BANDS AVAILABE. FIX STACK AND LEAVE
234: UFBGE3: POP     P,AC1                   ;GET BACK ARGUEMENT
235:         TLNE    AC1,403777              ;ANY OFFSET?
236:         HLLM    AC1,(AC3)               ;YES, SET IT
237:         LDB     AC2,[POINT 2,AC1,2]     ;GET READ/WRITE ENABLE BITS.
238:         DPB     AC2,FBPROT              ;STUFF THEM INTO PROTECTION FIELD.
239:         LDB     UCHN,PUUOAC             ;PICK UP ACCUMULATOR NUMBER AGAIN
240:         AOS     (P)
241:         HLL     TAC,(AC3)               ;GET THE OFFSET
242:         DPB     AC2,[POINT 2,TAC,2]     ;STUFF THE FOREIGN ENABLE BITS INTO TAC.
243:         HRRI    TAC,400000-FBBAND(AC3)  ;LOAD 400000+PHYSICAL NUMBER IN TAC
244:         JRST    STOTAC
245: 
246: UFBGE2: HRRZI   AC3,FBBAND-400000(UCHN) ;MAKE POINTER
247:         LDB     AC1,FBJOBP              ;IS THIS BAND CLAIMED?
248:         JUMPE   AC1,UFBGE4              ;NO. WE CLAIM IT
249:         CAIN    J,(AC1)                 ;PERHAPS THIS IS OURS ALREADY?
250:         JRST    UFBGE3                  ;YES. 
251:         JRST    TPOPJ                   ;WE CAN'T HAVE THIS BAND.
252: 
253: UFBGE4: DPB     J,FBJOBP                ;WE HAVE IT NOW
254:         JRST    UFBGE3
255: 
256: OFFTL:  JSP     TAC,UUOMES
257:         ASCIZ   /OFFSET TOO LARGE, UUO/
258: 
259: 
260: UFBGIV:HRRZ    UCHN,TAC                ;UUO TO RELEASE A FAST BAND
261:         JRST    FBGIVE
    FBPACK page# 0008 next  prev
263: ;UUO TO GET PHYSICAL BAND NUMBER AND OFFSET
264: ; CALLING . . .
265: ;       MOVE AC,<LOGICAL OR PHYSICAL BAND NUMBER>
266: ;       CALL AC,[SIXBIT /UFBPHY/]
267: ; RETURNS 0 IF NO SUCH BAND
268: ; RETURNS OFFSET IN LH AND PHYSICAL BAND IN RH
269: ; SETS BIT 2 IF YOU HAVE READ ACCESS
270: ; SETS BIT 1 IF YOU HAVE WRITE ACCESS
271: 
272: FBPHY: SKIPN   FBACT                   ;ARE FAST BANDS ACTIVE TODAY.
273:         JRST    UUOERR                  ;NO.
274:         TRNE    TAC,400000              ;PHYSICAL OR LOGICAL?
275:         JRST    SPHYB                   ;PHYSICAL.
276:         MOVEI   UCHN,(TAC)              ;GET THE LOGICAL NUMBER.
277:         PUSHJ   P,FBSEARCH              ;SEARCH FOR THIS BAND NUMBER.
278:         JRST    RTZERO                  ;NO THERE. TELL HIM 0.
279: FBPHY1: LDB     AC1,FBLOGP              ;GET THE LOGICAL NUMBER
280:         CAIE    AC1,(UCHN)              ;IS THIS THE RIGHT ONE.
281:         JRST    RSH                     ;NO. CONTINUE SEARCH
282:         HLL     TAC,(AC3)               ;GET THE OFFSET FIELD.
283:         HRRI    TAC,400000-FBBAND(AC3)  ;GET 400000+PHYSICAL NUMBER
284: FBPHY2: TLO     TAC,300000              ;OWNER HAS READ AND WRITE ACCESS.
285:         JRST    STOTAC                  ;RETURN DATA TO USER.
286: 
287: RSH:    PUSHJ   P,FBRESEARCH            ;LOOK FOR ANOTHER BAND BELONGING TO THIS JOB
288:         JRST    RTZERO                  ;NONE THERE.
289:         JRST    FBPHY1                  ;CHECK TO SEE IF ITS THE RIGHT ONE.
290: 
291: SPHYB:  MOVEI   AC3,FBBAND-400000(TAC)  ;GET THE POINTER
292:         HLL     TAC,(AC3)               ;GET THE OFFSET FIELD.
293:         LDB     AC1,FBJOBP              ;GET THE JOB NUMBER
294:         CAIN    AC1,(J)                 ;SAME AS US?
295:         JRST    FBPHY2                  ;YES. OWNER HAS READ&WRITE ACCESS.
296:         LDB     AC1,FBPROT              ;GET THE PROTECTION CODE.
297:         DPB     AC1,[POINT 2,TAC,2]     ;STUFF THE PROT CODE.
298:         JRST    STOTAC                  ;RETURN DATA TO USER.
299: 
300: RTZERO: LDB     UCHN,PUUOAC
301:         XCTR    XW,[SETZM (UUO)]
302:         POPJ    P,
    FBPACK page# 0009 next  prev
304: ;UUO TO TELL YOU IF YOU HAVE A TRANSFER IN PROGRESS
305: ; CALLING . . .
306: ;       CALL [SIXBIT /UFBSKP/]
307: ;       <ONE IN PROGRESS>
308: ;       <NO TRANSFER IN PROGRESS>
309: 
310: FBSKP: MOVEI   AC1,FBINP               ;CHECK TRANSFER IN PROGRESS BIT
311:         TDNN    AC1,JBTSTS(J)           ;FROM JBTSTS.
312:         AOS     (P)                     ;NONE IN PROGRESS
313:         POPJ    P,
314: 
315: ;UUO TO WAIT FOR A TRANSFER IN PROGRESS
316: ; CALLING . . .
317: ;       CALL [SIXBIT /FBWAIT/]
318: 
319: FBWT:  PUSHJ   P,FBSKP                 ;IS THERE A TRANSFER IN PROGRESS.
320:         JRST    FBCW                    ;YES. WAIT NOW FOR IT TO FINISH
321:         POPJ    P,                      ;NO TRANSFER IN PROGRESS. 
322: 
323: ; UUO TO TELL YOU IF THE LAST TRANSFER GOT AN ERROR.
324: ; CALLING . . .
325: ;       CALL [SIXBIT /UFBERR/]
326: ;       <ERROR OCCURRED>
327: 
328: FBERR: MOVEI   AC1,FBERP               ;TEST THE ERROR BIT FROM JBTSTS
329:         TDNN    AC1,JBTSTS(J)
330:         AOS     (P)
331:         POPJ    P,
    FBPACK page# 0010 next  prev
333: ;ROUTINE TO GET A BAND AT ANY LEVEL
334: ; CALLING . . .
335: ;       MOVE UCHN,<LOGICAL BAND NUMBER, 0-31>
336: ;       MOVE ITEM,<JOB NUMBER THAT IS CLAIMING THE BAND>
337: ;       PUSHJ PDP,FBGET
338: ;       <RETURNS HERE IF NONE LEFT>
339: ; RETURNS PHYSICAL BAND NUMBER IN TAC
340: 
341: FBGET: SKIPN   FBACT           ;ARE FAST BANDS THERE TODAY?
342:         POPJ    P,              ;NO.
343:         PUSHJ   P,FBGIVE        ;GIVE BACK IF WE HAVE THIS LOGICAL ONE ALREADY.
344:         MOVE    AC3,[XWD -NBANDS,FBBAND]
345: FBGET1: SKIPN   (AC3)           ;IS THIS BAND FREE?
346:         JRST    FBGET3          ;YES. CLAIM THIS.
347:         AOBJN   AC3,FBGET1      ;THIS ONE IS IN USE, TRY NEXT ONE
348:         MOVE    AC3,[XWD -NBANDS,FBBAND]
349: FBGET2: MOVEI   TAC,77
350:         AND     TAC,(AC3)       ;PICKUP JOB NUMBER FIELD.
351:         JUMPE   TAC,FBGET3      ;JOB NUMBER IS ZERO. WE'LL CLAIM IT.
352:         AOBJN   AC3,FBGET2
353:         POPJ    P,              ;THERE ARE NONE LEFT.
354: 
355: FBGET3: DPB     J,FBJOBP        ;STORE JOB NUMBER.
356:         TRNN    UCHN,400000     ;DON'T SET LOGICAL NUMBER IF PHYSICAL
357:         DPB     UCHN,FBLOGP     ;PUT LOGICAL BAND NUMBER IN PLACE
358:         MOVEI   TAC,400000-FBBAND(AC3)
359:         AOS     (P)
360:         POPJ    P,
361: 
362: FBSEARCH:
363:         MOVE    AC3,[XWD -NBANDS,FBBAND]        ;LOAD UP AOBJN POINTER
364: FBSEA1: SKIPLE  AC1,(AC3)       ;IS THIS BAND CLAIMED?
365:         JRST    FBSEA2          ;BAND IS CLAIMED.
366: FBRESEARCH:
367:         AOBJN   AC3,FBSEA1
368:         POPJ    P,
369: 
370: FBSEA2: ANDI    AC1,77          ;GET THE JOB NUMBER FIELD ONLY!
371:         CAIN    AC1,(J)         ;BELONGS TO THIS JOB?
372:         JRST    CPOPJ1          ;YES.
373:         JRST    FBRESEARCH
    FBPACK page# 0011 next  prev
375: ;ROUTINE TO RELEASE A BAND AT ANY LEVEL
376: ; CALLING . . .
377: ;       MOVE UCHN,<LOGICAL BAND NUMBER>
378: ;       MOVE ITEM,<JOB NUMBER THIS BAND BELONGS TO>
379: ;       PUSHJ PDP,FBGIVE
380: 
381: FBGIVE:SKIPE   FBACT           ;FAST BANDS TODAY?
382:         PUSHJ   P,FBSEARCH      ;YES. LOOK FOR A BAND FOR THIS JOB.
383:         POPJ    P,              ;NONE THERE OR NO FAST BANDS.
384: FBGIV1: TRNE    UCHN,400000     ;IS THIS A PHYSICAL NUMBER?
385:         JRST    FBGIV3          ;YES.
386:         LDB     AC1,FBLOGP      ;IS THIS THE BAND WE WANT?
387:         CAME    AC1,UCHN
388:         JRST    FBGIV2          ;NOPE.
389: FBGIV4: LDB     AC1,FBLUZP      ;PRESERVE THE LOSE COUNT.
390:         SETZM   (AC3)           ;YES, CLEAR IT OUT
391:         DPB     AC1,FBLUZP
392:         POPJ    P,
393: 
394: FBGIV3: CAIN    UCHN,400000-FBBAND(AC3)         ;PHYSICAL NUMBER THE SAME?
395:         JRST    FBGIV4
396: FBGIV2: PUSHJ   P,FBRESEARCH    ; NO, TRY FOR ANOTHER ONE
397:         POPJ    P,
398:         JRST    FBGIV1
399: 
400: ;;ROUTINE TO FLUSH ALL A JOB'S BANDS
401: ; CALLING . . .
402: ;       MOVE ITEM,<JOB NUMBER>
403: ;       PUSHJ PDP,FBFLUSH
404: 
405: FBFLUSH:
406:         HRRZS   JBTSWP(J)
407:         HRRZS   JB2SWP(J)
408:         SKIPN   FBACT
409:         POPJ    P,              ;NO FAST BANDS ACTIVE. 
410:         PUSHJ   P,FBSEARCH      ;LOOK FOR BANDS BELONGING TO ME.
411:         POPJ    P,
412:         PUSH    P,TAC
413: FBFLU1: LDB     TAC,FBLUZP      ;FLUSH THIS BAND
414:         SETZM   (AC3)
415:         DPB     TAC,FBLUZP
416:         PUSHJ   P,FBRESEARCH    ;SEARCH FOR ANOTHER ONE
417:         JRST    TPOPJ           ;NONE.
418:         JRST    FBFLU1
    FBPACK page# 0012 next  prev
420: ;ROUTINES TO READ AND WRITE A FAST BAND
421: ; CALLING . . .
422: ;       MOVE TAC,<CORE ADDRESS, INDEXED BY PROG IF FOR A USER>
423: ;       MOVE UCHN,<LOGICAL BAND NUMBER>
424: ;       MOVE AC2,<WORD COUNT AS A POSITIVE NUMBER>
425: ;       MOVE TAC1,<DISK ADDRESS, LESS THAN 1216 DECIMAL>
426: ;       MOVE ITEM,<JOB NUMBER>
427: ;IF AT CLOCK LEVEL, MUST INCLUDE ONE MORE PARAMETER . . .
428: ;       MOVE DAT,<CLOCK LEVEL ADDRESS TO JUMP TO WHEN TASK DONE>
429: ;       PUSHJ P,FBWRITE   OR   PUSHJ P,FBREAD
430: 
431: ; SKIPS UPON SUCCESSFUL COMMENCEMENT OF OPERATION AT ALL LEVELS
432: ; AT UUO LEVEL, RETURNS WHEN OP COMPLETE AND SKIPS ON SUCCESSFUL EXECUTION
433: ; AT CLOCK LEVEL, RETURNS TO ADDRESS IN DAT WITH ERROR BITS IN TAC, OR ZERO IF SUCCESSFUL
434: 
435: FBWRITE:
436:         PUSHJ   P,FBWRT
437:         POPJ    P,
438:         CONO    PI,DSKON
439:         JRST    CPOPJ1
440: 
441: FBWRT:  MOVEI   IOS,WREN
442:         PUSHJ   P,FBSET
443:         MOVN    AC3,AC3
444:         PUSHJ   P,FBCOM
445:         JRST    CPOPJ1
446: 
447: ; READ A BAND
448: ; SAME CALLING SEQUENCE AS IN FBWRITE
449: 
450: FBREAD:
451:         PUSHJ   P,FBRD
452:         POPJ    P,
453:         CONO    PI,DSKON
454:         JRST    CPOPJ1
455: 
456: FBRD:   MOVEI   IOS,RDEN
457:         PUSHJ   P,FBSET         ; GET PHYSICAL BAND NUMBER FROM LOGICAL NUMBER
458:         PUSHJ   P,FBCOM
459:         JRST    CPOPJ1
    FBPACK page# 0013 next  prev
461: ;THIS ROUTINE GETS THE PHYSICAL BAND NUMBER FROM THE LOGICAL BAND NUMBER
462: ; IN ACCUMULATOR UCHN AND THE JOB NUMBER IN ITEM. IF THE BAND IS NOT INITIALIZED,
463: ; THE ROUTINE POP'S OFF THE RETURN AND POPJ'S BACK. IF THE BAND IS FOUND, THE
464: ; PHYSICAL BAND NUMBER IS PUT IN AC3.
465: 
466: FBSET:  SKIPN   FBACT           ;ANY FAST BANDS TODAY?
467:         JRST    TPOPJ
468:         TRNE    UCHN,400000     ;IS THIS A PHYSICAL BAND?
469:         JRST    FBSET3          ;YES.
470:         PUSHJ   P,FBSEARCH      ;SEARCH FOR THE LOGICAL BAND HE REQUESTED
471:         JRST    TPOPJ           ;ERROR - HE HAS NOT ASSIGNED THAT BAND YET
472: FBSET1: LDB     AC1,FBLOGP      ;THIS BAND BELONG TO THIS JOB. GET LOGICAL NUMBER
473:         CAIN    AC1,(UCHN)      ;IS THIS THE RIGHT LOGICAL BAND?
474:         JRST    FBSET4          ;YES. SAME LOGICAL BAND.
475:         PUSHJ   P,FBRESEARCH    ;NO, FIND NEXT BAND IN HIS NAME
476:         JRST    TPOPJ           ;ERROR. LOGICAL BAND NUMBER NOT INITIALIZED
477:         JRST    FBSET1          ;GO TEST THIS BAND.
478: 
479: FBSET3: MOVEI   AC3,FBBAND-400000(UCHN) ;GET POINTER TO PHYSICAL BAND.
480:         LDB     AC1,FBJOBP      ;GET THE JOB NUMBER OF BAND OWNER.
481:         ANDI    UCHN,177        ;CLEAN OUT THE SHIT
482:         MOVE    TEM,JBTPRV(J)   ;GET PRIVILEGES.
483:         TLNN    TEM,FBWPRV      ;DOES THIS GUY HAVE ACCESS?
484:         CAIN    AC1,(J)         ;OR IS THIS THE OWNER?
485:         JRST    FBSET4          ;YES. OPERATION PROCEEDES.
486:         CAMN    UCHN,SYSBND     ;DOES HE WANT THE SYSTEM BAND?
487:         JRST    FBSYSB          ;YES. GO BLESS HIM
488:         LDB     AC1,FBPROT      ;
489:         SKIPL   (AC3)           ;SKIP IF BAD BAND.
490:         TDNN    AC1,IOS         ;CHECK PROTECTION BITS
491:         JRST    TPOPJ           ;ACCESS IS NOT ALLOWED.
492: FBSET4: MOVEI   AC3,-FBBAND(AC3);GET PHYSICAL NUMBER IN AC3
493:         HRRZ    TAC1,TAC1       ;ZERO LEFT SIDE OF TAC1
494:         CAMN    AC3,SYSBND      ;IS THIS THE SYSTEM BAND?
495:         CAIE    IOS,WREN        ;YES. WRITING ON SYSBAND?
496:         POPJ    P,              ;NO.
497: ;       SETZM   SYSTHERE        ;THE SYSTEM IS NOW CLOBBERED
498:         POPJ    P,
499: 
500: 
501: FBSYSB: CAIE    IOS,WREN        ;IS HE WRITING ON SYSTEM BAND?
502:         JRST    FBSET4          ;NO. ANYONE MAY READ
503:         JRST    TPOPJ           ;SCREW HIM.
504: 
505: FBTVIN:
506:         SETOM   TAC1            ; FLAG TV REQUEST WITH -1 DISK ADDRESS
507:         PUSHJ   P,FBCOM         ; FROM HERE ON OUT, TREAT AS A STANDARD REQUEST
508:         CONO    PI,DSKON
509:         POPJ    P,
    FBPACK page# 0014 next  prev
511: ;COMMON READ-WRITE ROUTINE
512: 
513: FBCOM:  PUSH    P,AC3                   ;SAVE BAND NUMBER ON STACK
514:         MOVEI   AC3,FBSIZ               ;GET A TASK BLOCK FROM FREE STORAGE
515:         PUSHJ   P,FSGET
516:         JRST    FBCOM5                  ;OOPS. WE'LL HAVE TO USE THE SPARE.
517: FBCOM3: MOVEM   TAC,FBADR(AC1)          ;LOAD UP THE TASK BLOCK WITH GOOD STUFF
518:                                         ;IN CASE OF TV THIS IS COMMAND BLOCK ADDRESS
519:         MOVEM   AC2,FBWC(AC1)           ;THE WORD COUNT
520:         MOVEM   TAC1,FBDA(AC1)          ;THE DISK SECTOR ADDRESS 
521:                                         ;(BAND AND TRACK IS ADDED IN AT I-LEVEL)
522:                                         ;(-1 FOR TV CALL)
523:         MOVEM   J,FBJOB(AC1)            ; SAVE JOB NUMBER FOR UUO-LEVEL CALLS
524:         MOVEI   DSER,=10                ; ONLY TEN RETRIES
525:         MOVEM   DSER,FBRETRY(AC1)
526:         POP     P,FBBND(AC1)            ;STORE PHYSICAL BAND NUMBER 
527:         MOVEM   DAT,FBDONE(AC1)         ;CLOCK LEVEL ADDRESS WHEN TASK DONE
528:         CONSZ   PI,1(17-CLKCHN)        ;NOW, ARE WE AT UUO LEVEL?
529:         JRST    FBCOM2                  ;WE ARE AT CLOCK LEVEL.
530:         JUMPL   TAC1,FBCOM2             ;TV CALLS HAVE ALREADY LOCKED JOB.
531:         AOS     JBTGLU(J)               ;PIN DOWN THIS JOB.
532: IFN FTSTAT,<PUSHJ P,GLUSTT>
533:         MOVNI   DSER,IOWQ               ;SET US INTO THE WAIT QUEUE NOW
534:         SKIPN   FBDONE(AC1)             ;AVOID REQUEING IF DOING NO-WAIT UUOS
535:         MOVEM   DSER,JOBQUE(J)
536: FBCOM2: MOVEI   TEM,DSKSTART            ;READY FOR I-LEVEL. GET STARTUP DISPATCH
537:         CONO    PI,DSKOFF               ;TURN OFF THE DISK.
538:         HLRZ    DSER,FBQUE              ;ADD OUR TASK TO THE END OF THE TASK LIST
539:         SKIPE   DSER                    ;LH OF FBQUE POINTS TO LAST TASK IN LIST,
540:                                         ; RH TO FIRST
541:         MOVEM   AC1,FBLINK(DSER)        ;LINK FROM THE LAST TASK TO THIS TASK
542:         HRLM    AC1,FBQUE               ;UPDATE POINTER TO END OF LIST
543:         SKIPN   DSER
544:         HRRM    AC1,FBQUE               ;IF ONLY TASK, UPDATE POINTER TO FIRST TASK
545:         SETZM   FBLINK(AC1)             ;SINCE WE ARE THE LAST TASK, ZERO OUR LINK
546:         SKIPL   FBBUSY                  ;IS THE DISK BUSY NOW?
547:         POPJ    P,                      ;YES, WE DO NOT HAVE TO START IT UP
548:         MOVEM   TEM,FBBUSY              ;NO. STORE DISPATCH LOCATION
549:         MOVEI   TEM,IOPANY!IOPJDN       ;RESET CH6 CONSZ BITS
550:         HRRM    TEM,DIPCON              ;
551:         CONO    IOP,IOPJDN!DSKCHN       ;SET JBDN TO MAKE A STARTUP INTERRUPT.
552:         POPJ    P,
553: 
554: FBCOM5: SKIPE   FBSBUSY                 ;NO SYSTEM FS LEFT. USE OUR SPARE!
555:         HALT    FBCOM4                  ;SPARE BUSY, CAN'T HAPPEN.
556: FBCOM4: SETOM   FBSBUSY                 ;SET SPARE BUSY.
557:         MOVEI   AC1,FBSPARE
558:         JRST    FBCOM3
    FBPACK page# 0015 next  prev
560: ;INTERRUPT LEVEL CODE . . .
561: 
562: IFBINT:
563:         BEGIN   IFBINT
564:         JSR     DSKSAV          ;SAVE AC'S.
565: IFBIN1: SKIPGE  AC1,FBBUSY      ;PICK UP THE DISPATCH ADDRESS.
566:                                 ;THIS IS -1 IF DISK IDLE
567:         JRST    UNIOP           ;UNEXPECTED INTERRUPT.
568:         SETOM   FBBUSY          ;DISK NOW IDLE.
569:                                 ;INITIALIZE DISPATCH ADDRESS AND DISPATCH!
570:         JRST    (AC1)           ;DISPATCH.
571: 
572: UNIOP:  PUSHACS
573:         PUSHJ   P,DISDATE
574:         PUSHJ   P,DISMES
575:         ASCIZ   /ππUNEXPECTED IOP INTERRUPT
576: /
577:         POPACS
578: IOPIN1: CONO    IOP,DSKCHN
579:         SETZM   FBTASK          ;FLUSH CURRENT TASK.
580:         POPJ    P,
581: 
582: ↑↑DFBINT:
583:         CONO    DSK,0           ;STOP THE DISK, I WANT TO GET OFF!
584:         ROT     44              ;WAIT FOR THE IOP TO COOL OFF. LONG NO-OP
585:         JSR     DSKSAV          ;SAVE AC'S.
586:         CONO    IOP,DSKCHN      ;SET UP IOP WITH PI CHANNEL.
587:         EXCH    AC1,FBBUSY      ;ARE WE BUSY NOW?
588:         CAME    AC1,[-1]        ;
589:         JRST    DFBGO           ;WE WERE BUSY.
590: DFBFLS: EXCH    AC1,FBBUSY      ;PUT AC1 BACK.
591:         CONO    DSK,1B23!1B24!DSKCHN    ;CLEAR ERROR BITS AND SET PI CHANNEL
592:         POPJ    P,              ;AND RETURN.
593: 
594: DFBGO:  EXCH    AC1,FBBUSY      ;RESTORE AC1
595:         CONSO   DSK,1B27        ;IS DISK ON LINE?
596:         JRST    IFBIN1          ;YES. GO PROCESS INTERRUPT.
597:         PUSHACS
598:         PUSHJ   P,DISDATE
599:         PUSHJ   P,DISMES
600:         ASCIZ   /ππUNEXPECTED LIBRASCOPE INTERRUPT
601: /
602:         POPACS
603:         JRST    DSKSTART
    FBPACK page# 0016 next  prev
605: ;FIRST, THE DISK STARTUP ROUTINE . . .
606: 
607: DSKSTART:
608:         HRRZ    AC1,FBQUE       ;POP THE FIRST TASK OFF THE TASK LIST
609:         JUMPE   AC1,IOPIN1      ;NOTHING THERE, DISMISS INTERUPT AND LEAVE
610:         MOVE    DSER,FBLINK(AC1);LINK AROUND THE BLOCK
611:         HRRM    DSER,FBQUE      ;THIS IS NEW TOP OF LIST
612:         SKIPN   DSER            ;IF THE TOP ELEMENT IS THE BOTTOM TOO . . .
613:         SETZM   FBQUE           ;THEN ZERO BOTH FORWARD AND BACKWARD POINTERS
614:         MOVEM   AC1,FBTASK      ;NOW SAVE THE ADDRESS OF THIS TASK BLOCK
615:         MOVE    TAC1,FBDA(AC1)  ;PICK UP THE SECTOR ADDRESS
616:         AOJN    TAC1,DSKGOA     ;JUMP UNLESS A TV TRANSFER
617:         HLLZS   DIPCON          ;FIRST MAKE SURE WE WON'T GET THE INTERRUPT
618:         SETZM   FBBUSY          ;MAKE SURE THE WORLD KNOWS WE ARE BUSY
619:         JRST    TVRED           ;OFF TO TVSER.
620: 
621: DSKGOA: AOS     NLREQS          ;
622: DSKGO:  SETZ    TAC1,
623:         AOS     NLRERS
624:         MOVM    TEM,FBBND(AC1)  ;DEPOSIT PHYSICAL BAND NUMBER IN
625:                                 ;BITS 14-23 OF THE DISK DATAO WORD
626:         DPB     TEM,[POINT 8,TAC1,23]
627:         SETZ    DSER,
628:         CAMN    TEM,SYSBND      ;SYSTEM?
629:         JRST    DSKST2          ;YES, USE ZERO OFFSET
630:         HLRZ    DSER,FBBAND(TEM);SEE IF THE SECTOR OFFSET IS INITIALIZED YET
631:         JUMPN   DSER,DSKST2     ;YES IT IS, SKIP OVER THIS PART
632: DSKST3: DATAI   DSK,DSER        ;ON FIRST WRITEOUT, WE CAN JUST WRITE ANYWHERE
633:         TRNE    DSER,4000       ;GET THE CURRENT SECTOR NUMBER.
634:         JRST    DSKST3          ;SECTOR NUMBER INVALID
635:         ADDI    DSER,10         ;BUMP WHERE WE ARE BY 10 SECTORS FOR SAFETY
636:         HRLM    DSER,FBBAND(TEM);AND STORE THAT AS OUR SECTOR OFFSET
637: DSKST2: ANDI    DSER,3777       ;CLEAN IT UP
638:         ADD     DSER,FBDA(AC1)  ;ADD IN USER'S REQUESTED SECTOR OFFSET
639:         CAIGE   DSER,=1216      ;IF TRACK OVERRUN, BUMP TRACK NUMBER AND RESET SECTOR COUNT MOD 1216
640:         JRST    DSKST1
641:         CAIGE   DSER,=2432
642:         JRST    DSKST4
643:         SUBI    DSER,=2432
644:         JRST    DSKST1
645: 
646: DSKST4: TRO     TAC1,1B24       ;DISK STARTUP ROUTINE, SET COUNT AND START DISK
647:         SUBI    DSER,=1216
648: DSKST1: IOR     TAC1,DSER       ;NOW COMBINE BAND NUMBER, TRACK NUMBER, AND SECTOR ADDRESS
649:         MOVN    AC2,FBWC(AC1)   ;NOW START BUILDING THE IOP DATAO WORD WITH THE WORD COUNT
650:         MOVS    AC2,AC2         ;IN THE LEFT HALF, OF COURSE
651:         HRR     AC2,FBADR(AC1)  ;SO LET US RELOCATE IT PROPERLY
652:         SETZM   DSER
653:         SKIPGE  FBBND(AC1)      ; SET BIT 100 IN DSER IF THIS IS A WRITE OPERATION
654:         MOVEI   DSER,100        ; OUR BAND IS SET NEGATIVE IF THAT IS TRUE
655:         CONO    DSK,1B23!1B24!DSKCHN
656:         CONO    IOP,DSKCHN(DSER); GIVE THE 167 A CHANNEL AND A READ-WRITE BIT
657:         DATAO   IOP,AC2         ; GIVE IT A WORD COUNT AND A MEMORY ADDRESS
658:         MOVEM   AC2,LASTWC      ; STORE LAST WC SENT
659:         MOVEM   AC2,30          ; STORE IT SO WE CAN SEE IT WHEN MEMORY HANGS.
660:         JFCL                    ; WELL, IF DAVE SAYS SO . . .
661:         MOVEM   TAC1,LASTADR    ; SAVE THIS FOR ERROR TYPEOUT
662:         DATAO   DSK,TAC1        ; NOW THE DISK ADDRESS AND WE ARE OFF!
663:         MOVEI   AC1,FINOP       ; SET FINOP AS OUR DISPATCH ADDRESS ON THE NEXT TRANSFER
664:         MOVEM   AC1,FBBUSY
665:         POPJ    P,              ; DISMISS INTERRUPT AND WAIT
    FBPACK page# 0017 next  prev
667: ;COME HERE WHEN A TASK HAS BEEN COMPLETED . . .
668: 
669: FINOP:
670:         MOVE    AC1,FBTASK              ; PICK UP ADDRESS OF TASK BLOCK
671:         CONSZ   DSK,3770                ; WAS THERE A RED LIGHT ERROR LAST TIME?
672:         JRST    DSKERR                  ; YES, GO PROCESS IT (NEXT PAGE)
673:         CONSZ   IOP,IOPANY              ; DO THE SAME FOR IOP ERRORS
674:         JRST    IOPERR
675: FINOP1: SKIPG   DSER,FBRETRY(AC1)       ; ANY ERRORS?
676:         AOS     NLERRS                  ; YES, BUMP COUNT       
677:         JUMPLE  DSER,FINCNT             ; SKIP IF HARD ERROR
678:         CAIGE   DSER,=10                ; ANY SUCCESSES AFTER ERROR RETRIES?
679:         AOS     NSAERR                  ; YES, COUNT IT
680: FINCNT: SKIPN   DSER,FBDONE(AC1)        ; FORK FOR UUO AND CLOCK LEVEL CALLS
681:         JRST    FINOP2                  ;UUO WAIT TYPE.
682: 
683: ;;COME HERE TO COMPLETE A CLOCK LEVEL CALL . . .
684: 
685:         SKIPG   FBRETRY(AC1)            ; GIVE HIM SOME ERROR BITS TOO
686:         TRO     DSER,400000
687:         CONO    PI,PIOFF
688:         IDPB    DSER,CLKQ               ; MAKE CLOCK QUEUE REQUEST
689:         CONO    PI,PION
690: FINOP3: CAIE    AC1,FBSPARE             ; IS THIS THE SPARE?
691:         JRST    FINOP5                  ; NO. ORDINARY FS BLOCK
692:         SETZM   FBSBUSY                 ; YES, RELEASE IT.
693:         JRST    DSKSTART                ; PROCESS NEXT TASK.
694: FINOP5: PUSHJ   P,FSGIVE                ; NOW RELEASE THIS PIECE OF FREE STORAGE
695:         JRST    DSKSTART                ; AND GO SCAN FOR ANY MORE TASKS
696: 
697: ;;HERE TO COMPLETE A UUO LEVEL CALL . . .
698: 
699: FINOP2: MOVE    J,FBJOB(AC1)            ; PICK UP JOB NUMBER
700:         SOS     JBTGLU(J)               ; FREE HIM IN CORE
701: IFN FTSTAT,<PUSHJ P,GLUSTT>
702:         MOVM    AC1,JOBQUE(J)           ; STILL IN IOW?
703:         CAIE    AC1,IOWQ
704:         JRST    DSKSTART                ; NO, DON'T REQUE HIM
705:         MOVEI   AC1,RUNQ                ; YES, PUT HIM IN RUN QUEUE
706:         MOVNM   AC1,JOBQUE(J)
707:         PUSHJ   P,REQUE
708:         JRST    DSKSTART                ; NOW GO SCAN FOR FURTHER TASKS TO BE DONE
709:                                         ;TASK BLOCK WILL BE GIVEN BACK AT 
710:                                         ;UUO LEVEL (SEE FBCOM1)
    FBPACK page# 0018 next  prev
712: ;HERE AFTER THE TV CAMERA INTERRUPT HAS GONE OFF.
713: ;RESET DIPCON, OUR CONSZ LOCATION, AND GIVE THE TASK BLOCK BACK.
714: 
715: ↑↑FBDFINT:
716:         MOVEI   AC1,IOPANY!IOPJDN       ; CLEAN UP AFTER TV HAS DONE ITS THING
717:         HRRM    AC1,DIPCON
718:         MOVE    AC1,FBTASK              ; NOW RELEASE THE TASK BLOCK
719:         SETOM   FBBUSY                  ; AND MAKE THE SWAPPER FREE AGAIN
720:         JRST    FINOP3
    FBPACK page# 0019 next  prev
722: ;DISK ERROR HANDLER.
723: 
724: DSKERR: SKIPE   AC1,FBTASK              ;GET THE TASK BLOCK POINTER
725:         JRST    DSKERA                  ;WE HAVE ONE.
726:         PUSHACS
727:         PUSHJ   P,DISDATE               ;NO TASK BLOCK. WHAT ARE WE DOING HERE?
728:         PUSHJ   P,DISMES
729:         ASCIZ   /πππLIBRASCOPE ERROR WHILE IT WAS IDLE
730: 
731: /
732:         POPACS
733:         JRST    DSKSTART                ;ATTEMPT TO PROCESS MORE TASKS.
734: 
735: DSKERA: SOSLE   FBRETRY(AC1)            ;HAVE WE TRIED ENOUGH?
736:         JRST    DSKGO                   ;NO. TRY SOME MORE.
737:         PUSHACS
738:         MOVM    AC3,FBBND(AC1)          ;GET THE BAND NUMBER
739:         ADDI    AC3,FBBAND
740:         LDB     AC1,FBLUZP              ;GET THE LOSE COUNT.
741:         ADDI    AC1,1
742:         SETZM   (AC3)
743:         DPB     AC1,FBLUZP
744:         CAILE   AC1,7
745:         SETOM   (AC3)                   ;FORCE A PERMANENT BAD BAND.
746:         PUSHJ   P,DISERR
747:         [ASCIZ  /ππLIBRASCOPE ERROR.
748: LASTADR = /]
749:         DISARG(OCT,LASTADR)     ;HAS SECTOR, BAND, AND TRACK
750:         [ASCIZ/    LASTWC = /]
751:         DISARG(OCT,LASTWC)      ;WCMA
752:         [ASCIZ/    WCMA = /]
753:         -1
754:         DATAI   IOP,TAC
755:         PUSHJ   P,DISOCT                ;PRINT OUT CURRENT WCMA
756:         PUSHJ   P,DISMES
757:         ASCIZ   /
758: DISK BITS = /
759:         CONI    DSK,TAC
760:         PUSHJ   P,DISLOC
761:         PUSHJ   P,DISMES
762:         ASCIZ   /    IOP BITS = /
763:         CONI    IOP,TAC
764:         PUSHJ   P,DISLOC
765:         PUSHJ   P,DISCRLF
766:         PUSHJ   P,DISCRLF
767:         CONSO   DSK,1B31                ;WRITE ERROR?
768:         JRST    DSKERB                  ;NO. WE'VE DONE ENOUGH.
769:         PUSHJ   P,DISMES
770:         ASCIZ   /WRITE ERRORS. CALL PANOFSKY RIGHT NOW! DO NOT RELOAD!
771: /
772:         SETOM   DISFLAG                 ;FORCE TYPEOUT
773:         PUSHJ   P,DISFLUSH
774:         SKIPN   INDDT                   ;IF DDT IS NOW IN, CALL IT
775:         HALT    DSKERB                  ;OTHERWISE, JUST HALT
776:         PUSHJ   P,DDTCALL               ;CALL DDT (IF THERE)
777: DSKERB: POPACS                          ;RESTORE AC'S AND RETURN.
778:         JRST    FINOP1
    FBPACK page# 0020 next  prev
780: ;IOP ERROR RECOVERY
781: 
782: IOPERR: SKIPE   AC1,FBTASK
783:         JRST    IOPERA
784:         PUSHACS
785:         PUSHJ   P,DISDATE
786:         PUSHJ   P,DISMES
787:         ASCIZ   /ππIOP ERROR WHILE DISK WAS IDLE
788: 
789: /
790:         POPACS
791:         JRST    DSKSTART
792: 
793: IOPERA: CONI    IOP,TAC
794:         DATAI   IOP,IOPWCM      ;SAVE IOP WCMA.
795:         MOVE    DSER,IOPWCM
796:         SUB     DSER,FBADR(AC1) ;ADR FROM START OF XFER
797:         MOVEI   DSER,-1(DSER)   ;OFF BY AT LEAST 1, ALSO FLUSH WC
798:         TRNE    DSER,36         ;MORE THAN 2 WORDS IN?
799:         SOJ     DSER,           ;YES, EARLY RQ MKES US OFF BY 2
800:         ADD     DSER,FBADR(AC1) ;PUT ORG BACK - SHOULD NOW BE EXACT ADR
801:         CONO    DSK,0           ; CLEAR ANY ERROR BITS WHAT MAY BE
802:         CONSO   IOP,IOPMIS      ;IGNORE PAR ERR WITH DATA MISS
803:         CONSO   IOP,IOPPAR      ;PARITY ERROR?
804:         JRST    PARIOP          ;NO.
805:         MOVE    TEM,-1(DSER)    ;CAST ABOUT LOOKING FOR BAD PARITY.
806:         MOVE    TEM,1(DSER)     ;LOOK HERE TOO.
807:         MOVE    TEM,(DSER)      ;REFERENCE IT TO CALL PARSER
808:         CONO    IOP,0           ;SET TO READ
809:         DATAO   IOP,[IOPWRD]    ;INTO THIS CELL
810:         CONO    IOP,2200        ;SET RDY & BRRQ, WHICH WILL STORE BR
811:         PUSHACS
812:         PUSHJ   P,DISDAT
813:         PUSHJ   P,DISERR
814:         [ASCIZ  /IOP PARITY ERROR, LOC /]
815:         DISARG  LOC,<DSER-20(P)>
816:         [ASCIZ  /  BR=/]
817:         DISARG  OCT,IOPWRD
818:         [ASCIZ  /, C(LOC)=/]
819:         DISARG  OCT,<TEM-20(P)>
820:         [ASCIZ  /
821: LASTWC=/]
822:         DISARG  OCT,LASTWC
823:         [ASCIZ  /  IOP CONI = /]
824:         DISARG  LOC,<TAC-20(P)>
825:         [ASCIZ  /   FBRETRY = /]
826:         -1
827:         MOVE    TAC,AC1-17(P)   ;GET REAL AC1 INTO TAC
828:         MOVE    TAC,FBRETRY(TAC)
829:         PUSHJ   P,DISDCP
830:         PUSHJ   P,DISMES
831:         BYTE(7)15,12,12         ;CR,LF,LF,LF
832:         POPACS
833: PARIOP: TRNE    TAC,100         ;I OR O
834:         JRST    NFBINP          ;NOT INPUT
835:         SETZM   (DSER)          ;FIX BAD PARITY WHICH DATA MISS CAN MAKE
836:         HRRZ    TEM,LASTWC      ;GET START OF TRANSFER
837:         CAILE   TEM,-1(DSER)    ;IS PREVIOUS WORD IN TRANSFER?
838:         SETZM   -1(DSER)        ;YES, CLEAR IT ALSO
839:         CAILE   TEM,-2(DSER)    ;HOW ABOUT THIS ONE?
840:         SETZM   -2(DSER)        ;YES, CLEAR IT TOO (BETTER SAFE THAN SORRY)
841: NFBINP: TRNE    TAC,IOPRLY      ;IOP EARLY RESPONSE?
842:         SKIPN   IEARLY          ;ARE WE ENABLE FOR THIS PRINTOUT?
843:         JRST    RLYIOP
844:         PUSHACS
845:         PUSHJ   P,DISMES
846:         ASCIZ   /IOP EARLY RESPONSE   /
847:         PUSHJ   P,DISDATE
848:         PUSHJ   P,DISERR
849:         [ASCIZ  /CONI = /]
850:         DISARG  LOC,<TAC-20(P)>
851:         [ASCIZ  /;  LASTWC = /]
852:         DISARG  OCT,LASTWC
853:         [ASCIZ  /;  WCMA = /]
854:         DISARG  OCT,IOPWCM
855:         [ASCIZ  /
856: 
857: /]
858:         -1
859:         POPACS
860: RLYIOP: SOSLE   FBRETRY(AC1)
861:         JRST    DSKGO
862:         MOVEI   DSER,=10
863:         MOVEM   DSER,FBRETRY(AC1)
864:         PUSHACS
865:         PUSHJ   P,DISDATE
866:         PUSHJ   P,DISERR
867:         [ASCIZ  /IOP ERROR; CONI = /]
868:         DISARG  LOC,<TAC-20(P)>
869:         [ASCIZ  /;  LASTWC = /]
870:         DISARG  OCT,LASTWC
871:         [ASCIZ  /;  WCMA = /]
872:         DISARG  OCT,IOPWCM
873:         [ASCIZ  /
874: 
875: /]
876:         -1
877:         POPACS
878:         JRST    DSKGOA
879: 
880: BEND IFBINT
881: BEND FBPACK
882: >
 EOF: FBPACK end-of-file. cnt=19